package club.weiyuanstudio.java.eedemo.iocdemo;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class Person {
    private String name;
    private Pet dog;

    Person() {
        this.name = "TEST NAME";
    }

    @Autowired
    public void setDog(Pet dog) {
        this.dog = dog;
    }

    public void show() {
        log.debug("My Name Is: " + name);
        log.debug("My Pet Is:" + dog.getName());
        log.debug("Let my dog say something:");
        dog.say();
    }
}
